package com.cn.util;

public class MaxArray {
    public static void main(String[] args) {
        int[] arr = {5, 44, 33, 55, 22};
//        arr[5];
        int max = arr[0];
//        for (int i = 0; i < arr.length - 1; i++) {
//            max = arr[i] > arr[i + 1] ? arr[i] : arr[i + 1];
//        }
        for (int i = 1; i < arr.length; i++) {
            if (max < arr[i]) {
                max = arr[i];
            }
        }
        System.out.println(max);
    }
}
